﻿using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text.Json.Serialization;

namespace BPM.Web.Shared.Data;

/// <summary>
/// 员工表
/// </summary>
[DisplayName("员工表")]
public class SysEmp : BaseVM
{
    /// <summary>
    /// 主键Id
    /// </summary>
    [DisplayName("业务号")]
    [Required(ErrorMessage = "业务号不能为空")]
    [JsonPropertyName("id")]
    public long Id { get; set; }

    /// <summary>
    /// 工号
    /// </summary>
    [DisplayName("工号")]
    [MaxLength(30)]
    public string? JobNum { get; set; }

    /// <summary>
    /// 机构Id
    /// </summary>
    [DisplayName("机构Id")]
    public long OrgId { get; set; }

    /// <summary>
    /// 机构名称
    /// </summary>
    [DisplayName("机构名称")]
    [MaxLength(50)]
    public string? OrgName { get; set; }

    /// <summary>
    /// 多对多（职位）
    /// </summary>
    public ICollection<SysPos> SysPos { get; set; } = new List<SysPos>();

    /// <summary>
    /// 多对多中间表（员工-职位）
    /// </summary>
    public List<SysEmpPos> SysEmpPos { get; set; } = new List<SysEmpPos>();
}
